package com.thinkingstar.iads.common.config;

import java.util.Map;
import org.nutz.dao.Dao;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.nutz.dao.impl.NutDao;


public class Globals extends BaseModule {

	private static final Logger LOGGER = LoggerFactory.getLogger(BaseModule.class);
    
    //虚拟目录路径
    public static String APP_BASE_PATH = "localhost:8080/iads";
    
    //虚拟目录名称
    public static String APP_BASE_NAME = "";
    
    //应用中文名
    public static String APP_NAME = "全过程智能设计辅助系统";
    
    //系统配置
    public static Map<String, String> SYS_CONFIG;
    
    //数据字典，根据ID分别初始化
    public static Map<String, Object> DATA_DICT;
    
    public static Map<String,NutDao> FORM_DAO  =  new HashMap<String,NutDao>();
 
    
    public static void InitNutDaoMap(Dao dao) {
        try {
            if (FORM_DAO == null) {
                FORM_DAO = new HashMap<String, NutDao>();
            }
        } catch (Exception e) {
            e.printStackTrace();
            LOGGER.error(e.getMessage());
        }
    }

    public static void InitSysConfig(Dao dao) {
        try {
            if (SYS_CONFIG == null) {
                SYS_CONFIG = new HashMap<String, String>();
            }
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }
}
